import request from '@/utils/request'

export function fetchMetadataLabelList(data) {
  return request({
    url: '/system/metadata/MetadataLabel/list',
    method: 'post',
    data,
  })
}

export function getMetadataLabel(id) {
  return request({
    url: '/system/metadata/MetadataLabel/detail/' + id,
    method: 'get',
    params: { id },
  })
}

export function createMetadataLabel(data) {
  return request({
    url: '/system/metadata/MetadataLabel/add',
    method: 'post',
    data,
  })
}

export function updateMetadataLabel(data) {
  return request({
    url: '/system/metadata/MetadataLabel/update',
    method: 'post',
    data,
  })
}

export function deleteMetadataLabel(ids) {
  return request({
    url: '/system/metadata/MetadataLabel/delete',
    method: 'post',
    data: { ids },
  })
}

export function getModelTree(data) {
  return request({
    url: '/system/metamodel/treeList',
    method: 'post',
    data,
  })
}
export function getFieldRelation(data) {
  return request({
    url: '/system/metaModel/fieldRelation/list',
    method: 'post',
    data,
  })
}

export function fieldRelation(data) {
  return request({
    url: '/system/metaModel/fieldRelation/list  ',
    method: 'post',
    data,
  })
}

export function getFieldRelationDetail(id) {
  return request({
    url: '/system/metadataModel/table/detail/' + id,
    method: 'get',
    params: { id },
  })
}

export function getFieldRelationEdgeDetail(id) {
  return request({
    url: '/system/metaModel/fieldRelation/detail/' + id,
    method: 'get',
    params: { id },
  })
}

export function metaModelfieldRelation(data) {
  return request({
    url: '/system/metaModel/fieldRelation/add',
    method: 'post',
    data,
  })
}

export function queryAssociationTable(data) {
  return request({
    url: '/system/metadataModel/table/queryAssociationTable',
    method: 'post',
    data,
  })
}

export function queryRelation(data) {
  return request({
    url: '/system/metaModel/fieldRelation/queryRelation',
    method: 'post',
    data,
  })
}
//修改目录
export function updateMasterdataDirectory(data) {
  return request({
    url: '/system/labelBind/LabelBind/update',
    method: 'post',
    data,
  })
}
export function deletecaveasmodelid({ id }) {
  console.log(id)
  return request({
    url: `/system/labelBind/LabelBind/detail/${id}`,
    method: 'get',
  })
}
